
<template>
    <div>
        <div class="order-icon">
            <img @click="doRemove()" style="margin-top:35px;margin-left:10px;" height="15" width="15" src="../../assets/game/icon_delete_24x24@2x.png">
        </div>
        <div class="order-item">
            <span style="font-size:14px;font-weight:800;margin-top:10px;color:red;"> {{formatBall()}} </span>
            <span style="font-size:14px;font-weight:800;margin-top:10px;color:blue;"> {{formatBlueBall()}} </span>
    
            <div style="font-size:12px;margin-top:5px;">{{formatMsg()}}</div>
    
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            msg: "",
        }
    },
    mounted() {
        //获取用户信息

    },
    props: ['ball', 'index'],
    computed: {
    },
    methods: {


        formatBall() {

            console.log("format ball ");
            console.log(this.ball)

            if (this.ball.betmode == "DT") {

                return "胆:" + this.ball.balls.join(" ") + " 拖:" + this.ball.ballstuo.join(" ");
            }

            if (this.ball.betmode == "DDT") {

                //                balls: balls,
                // ballsext: ballsext,
                // ballstuo: tuoballs,
                // ballsbluetuo: bluetuoballs,


                let str = "红胆:" + this.ball.balls.join(" ") + " 红拖:" + this.ball.ballstuo.join(" ");
                return str;
            }

            return this.ball.balls.join(" ");


        },
        formatBlueBallTuo() {



        },
        formatBlueBall() {

            if (this.ball.betmode == "DDT") {
                return " 蓝胆:" + this.ball.ballsext.join(" ") + " 蓝拖:" + this.ball.ballsbluetuo.join(" ");

            }

            return this.ball.ballsext.join(" ");

        },

        formatMsg() {
            let betmode = ""
            if (this.ball.betmode == "DS") {

                betmode = "单式";


            }
            if (this.ball.betmode == "FS") {

                betmode = "复式";
            }

            if (this.ball.betmode == "DT") {

                betmode = "胆拖";
            }

                 if (this.ball.betmode == "DDT") {

                betmode = "胆拖";
            }


            let zs = this.ball.zs;
            let money = this.ball.money;
            return `${betmode} ${zs}注 ${money}元`;



        },

        doRemove() {

            console.log("remove index:" + this.index);

            this.$emit("doRemove", this.index)
        },


        doPay() {

            this.$emit('doPay')

        }

    }

}

</script>

<style lang="scss" scoped>
.order-icon {
    float: left;
    margin-left: 20px;
    height: 86px;
    padding: 0px;
    width: 10%;
    background: rgb(244, 244, 244);
}

.align-center {
    clear: both;
    display: block;
    margin: auto;
}


.order-item {
    display: inline-block;
    width: 65%;
    height: 70px;
    padding-top: 15px;
    padding-left: 5%;
    padding-right: 10%;
    margin-left: 0%;
    margin-right: 0%;
    border-bottom: 1px dashed rgb(220, 220, 220);
    margin-top: 0px;
    margin-bottom: 0px;
    background: rgb(244, 244, 244);
}

.order-ball {
    margin-top: 15px;
    text-align: left;
    height: 44px;
    line-height: 44px;
    color: black;
    font-size: 18px;
    font-weight: 800;
    width: 70%;
}

.button-style {

    float: right;
    background: rgb(252, 204, 47);
    height: 33px;
    line-height: 33px;
    margin-top: 6px;
    width: 80px;
    border-radius: 4px;
    font-size: 16px;
    margin-right: 6px;
}
</style>
